<%--
  Created by IntelliJ IDEA.
  User: HAN
  Date: 2020/11/18
  Time: 19:57
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/styles.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/layui/css/layui.css">
    <script src="${pageContext.request.contextPath}/layui/layui.js"></script>
</head>
<body>
<div class="wrapper">

    <div class="container">
        <form class="layui-form" >
            <div class="layui-form-item">
                <label class="layui-form-label">用户名</label>
                <div class="layui-input-block">
                    <input type="text" name="name" lay-verify="title" autocomplete="off" placeholder="请输入用户名" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">密码框</label>
                <div class="layui-input-block">
                    <input type="text" name="password" placeholder="请输入密码" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">证件</label>
                <div class="layui-input-block">
                    <input type="text" name="idcard" lay-verify="title" autocomplete="off" placeholder="请输入用户名" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
                </div>
            </div>
        </form>
    </div>
</div>
<script>
    layui.use(['form','jquery','layer'],function () {
        var form =layui.form;
        var $=layui.jquery;
        var layer=layui.layer;
        form.on('submit(demo1)',function (data) {
            $.ajax({
                url:"/zhuce"
                ,data:data.field
                ,type:"post"
                ,success:function (ret) {
                        if(ret==1){
                            //alert("注册成功");
                            location.href="/webdenglu.jsp";
                        }else{
                            alert("注册失败");

                        }
                },error:function (mas) {
                    layer.msg("错误");
                }
            })
        })
    })
</script>
</body>
</html>
